<Schema name="FDTModbusScanIdentSchema" 
	xmlns="urn:schemas-microsoft-com:xml-data" 
	xmlns:dt="urn:schemas-microsoft-com:datatypes" 
	xmlns:modbusident="x-schema:FDTModbusIdentSchema.xml" 
	xmlns:fdt="x-schema:FDTDataTypesSchema.xml"
	xmlns:mb = "x-schema:FDTModbusAddressSchema.xml">


	<!--FDT ScanIdent schema V1.0 for Modbus protocol -->
	<!-- The  FDT DeviceTypeIdent schema defines the mapping of the Modbus identification objects -->
	<!-- to standard FDT identification elements -->
	<!-- The Modbus identification objects can be read with the standard Modbus service ReadDeviceIdentification -->

	<!-- The mapping of Modbus identification objects to FDT identification elements is divided into two categories: -->

	<!-- - Basic category: -->
	<!--   Mapping of mandatory Modbus identification objects to required (mandatory) FDT identification elements -->

	<!-- - Regular category: -->
	<!--   Mapping of optional Modbus identification objects to the optional FDT identification element IdValue-->


	<!--Definition of general FDT attributes-->
	<AttributeType name = "schemaVersion" dt:type = "number" default = "1.0"/>
	<AttributeType name="resultState" dt:type="enumeration" dt:values="provisional final error"/>
	<AttributeType name="configuredState" dt:type="enumeration" dt:values="configuredAndPhysicallyAvailable configuredAndNotPhysicallyAvailable availableButNotConfigured notApplicable"/>

	<!-- Definition of general FDT elements which contain the information about the applied protocol, -->
	<!-- the version of the protocol, the connection type and the address -->

	<ElementType name="IdBusProtocol" content="empty" model="closed">
		<attribute type = "modbusident:protocolName" required="yes"/>
	</ElementType>

	<ElementType name="IdAddress" content="eltOnly" model="closed">
		<!--Modbus specific addressing depending on connection type -->
		<group order = "one" maxOccurs="1" minOccurs="1">
			<element type = "mb:ModbusSerial"/>
			<element type = "mb:ModbusTCP"/>
		</group>
	</ElementType>


	<!-- Basic category: -->
	<!-- Mapping of Modbus identification elements required by the FDT DTMDeviceTypeIdent schema-->
	<!-- These elements represent all mandatory objects for Modbus device identification (basic category) -->

	<!--Modbus identification object VendorName is mapped to FDT element IdManufacturer -->
	<ElementType name="IdManufacturer" content="empty" model="closed">
		<attribute type = "modbusident:vendorName" required="yes"/>
	</ElementType>

	<!--Modbus identification object ProductCode is mapped to FDT element IdTypeID -->
	<ElementType name="IdTypeID" content="empty" model="closed">
		<attribute type = "modbusident:productCode"  required="yes"/>
	</ElementType>

	<!--Modbus identification object MajorMinorRevision is mapped to FDT element IdSoftwareRevision -->
	<ElementType name="IdSoftwareRevision" content="empty" model="closed">
		<attribute type = "modbusident:majorMinorRevision" required="yes"/>
	</ElementType>


	<!-- Regular category: -->
	<!-- Mapping of Modbus identification elements not required by the FDT DTMDeviceTypeIdent schema-->
	<!-- The information provided by each optional Modbus identification object (regular category) is mapped  -->
	<!-- to the standard FDT identification element IdValues, which may occur several times -->


	<!-- The following optional Modbus identification objects are supported: -->

	<!-- VendorUrl                       Attribute name/Protocol specific name:"vendorUrl"                      -->
	<!-- ProductName                  Attribute name/Protocol specific name:"productName"                -->
	<!-- ModelName                     Attribute name/Protocol specific name:"modelName"                   -->
	<!-- UserApplicationName     Attribute name/Protocol specific name:"userApplicationName"    -->   


	<ElementType name="IdValue" content="empty" model="closed">
		<attribute type="modbusident:name" required="yes"/>
		<attribute type="modbusident:value" required="yes"/>
		<attribute type="modbusident:protocolSpecificName" required="yes"/>
	</ElementType>


	<ElementType name="IdValues" content="eltOnly" model="closed">
		<element type="IdValue" minOccurs="0" maxOccurs="*"/>
	</ElementType>



	<!--FDT ScanIdentification element -->

	<ElementType name="ScanIdentification" content="eltOnly" model="closed">
		<attribute type="configuredState" required="no"/>
		<element type="fdt:CommunicationError" minOccurs="0" maxOccurs="1" />
		<element type="IdBusProtocol" minOccurs="1" maxOccurs="1"/>
		<element type="IdAddress" minOccurs="1" maxOccurs="1"/>
		<element type="IdManufacturer" minOccurs="1" maxOccurs="1"/>
		<element type="IdTypeID" minOccurs="1" maxOccurs="1"/>
		<element type="IdSoftwareRevision" minOccurs="1" maxOccurs="1"/>
		<element type="IdValues" minOccurs="0" maxOccurs="1"/>
	</ElementType>

	<ElementType name="ScanIdentifications" content="eltOnly" model="closed">
		<attribute type="fdt:busCategory" required="yes"/>
		<attribute type="resultState" required="yes"/>
		<element type="ScanIdentification" minOccurs="0" maxOccurs="*"/>
	</ElementType>

	<ElementType name="FDT" content="eltOnly" model="closed">
		<element type="ScanIdentifications" minOccurs="1" maxOccurs="1"/>
	</ElementType>
</Schema>
